package com.hyz.controller;

import com.hyz.pojo.Asset;
import com.hyz.service.AssetService;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author HGD
 * @date 2022/9/24 21:48
 */
@RestController
@RequestMapping("/asset")
public class AssetController {
    @Autowired
    private AssetService assetService;

    @PostMapping("/batchInsertAsset")
    public boolean batchInsertAsset(@RequestBody List<Asset> list) {
        LoggerFactory.getLogger(AssetController.class)
                .info("AssetController的batchInsertAsset被调用");
        return assetService.batchInsertAsset(list);
//        return true;
    }


    @PostMapping("/hello")
    public String hello(@RequestBody String name) {
        return "成功远程调用：hello " + name;
    }
}
